package com.zxjbyte.yiyi.extension.monitor.domain.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @Author zhangxingjia
 * @Date 2024/6/20 17:12
 * @Version: 1.0
 */
@Data
@Accessors(chain = false)
@Schema(description = "服务器信息响应结构体")
public class ServerInfoVO {

    @Schema(description = "CPU信息")
    private CpuInfo cpuInfo;

    @Schema(description = "内存信息")
    private MemoryInfo memoryInfo;

    @Schema(description = "存储信息")
    private StorageInfo storageInfo;

    @Schema(description = "服务器信息")
    private ServerInfo serverInfo;

    @Schema(description = "JVM信息")
    private JvmInfo jvmInfo;

    @Data
    public static class JvmInfo {

        @Schema(description = "JVM名称")
        private String jvmName;

        @Schema(description = "JVM版本")
        private String jvmVersion;

        @Schema(description = "JVM最大内存")
        private String jvmMemoryMax;

        @Schema(description = "JVM已分配内存")
        private String jvmMemoryTotal;

        @Schema(description = "JVM已分配内存的剩余空间")
        private String jvmMemoryFree;

        @Schema(description = "JVM最大可用内存")
        private String jvmMemoryUsable;

        @Schema(description = "JVM内存使用率")
        private String jvmUseRate;

        @Schema(description = "JVM启动时间")
        private String jvmStartTime;

        @Schema(description = "JVM运行时长")
        private String jvmRunTime;

        @Schema(description = "Java版本")
        private String javaVersion;

        @Schema(description = "Java安装路径")
        private String javaPath;
    }

    @Data
    public static class ServerInfo {

        @Schema(description = "服务器名称")
        private String serverName;

        @Schema(description = "服务器操作系统")
        private String serverOs;

        @Schema(description = "服务器版本")
        private String serverVersion;

        @Schema(description = "服务器IP")
        private String serverIp;

        @Schema(description = "服务器架构")
        private String serverArch;
    }

    @Data
    public static class StorageInfo {

        @Schema(description = "存储总量")
        private String storageTotal;

        @Schema(description = "存储已用")
        private String storageUsed;

        @Schema(description = "存储剩余")
        private String storageFree;

        @Schema(description = "存储使用率")
        private String storageUseRate;
    }

    @Data
    public static class MemoryInfo{

        @Schema(description = "内存总量")
        private String memoryTotal;

        @Schema(description = "内存已用")
        private String memoryUsed;

        @Schema(description = "内存剩余")
        private String memoryFree;

        @Schema(description = "内存使用率")
        private String memoryUseRate;
    }

    @Data
    public static class CpuInfo{

        @Schema(description = "CPU名称")
        private String cpuName;

        @Schema(description = "CPU数量")
        private Integer cpuNum;

        @Schema(description = "CPU物理核心数")
        private Integer cpuPhysicalCoreNum;

        @Schema(description = "CPU逻辑核心数")
        private Integer cpuLogicalCoreNum;

        @Schema(description = "CPU系统使用率")
        private String cpuSysUseRate;

        @Schema(description = "CPU用户使用率")
        private String cpuUserUseRate;

        @Schema(description = "CPU当前总使用率")
        private String cpuTotalUseRate;

        @Schema(description = "CPU当前等待率")
        private String cpuWaitRate;

        @Schema(description = "CPU当前空闲率")
        private String cpuFreeRate;
    }
}
